﻿using System.Collections;
using System.Collections.Generic;
using System.IO;
using Microsoft.Build.Framework;

namespace Adjunct.Build.Tasks
{
	public class MockNuspecTaskItem : ITaskItem
	{
		private readonly Dictionary<string,string> _metadata=new Dictionary<string, string>();

		public MockNuspecTaskItem(string projectPath) {
			_metadata["FullPath"] = Path.Combine(projectPath, "test.nuspec");
		}

		public string GetMetadata(string metadataName) {
			return _metadata.ContainsKey(metadataName) ? _metadata[metadataName] : string.Empty;
		}

		public void SetMetadata(string metadataName, string metadataValue) {
			throw new System.NotImplementedException();
		}

		public void RemoveMetadata(string metadataName) {
			throw new System.NotImplementedException();
		}

		public void CopyMetadataTo(ITaskItem destinationItem) {
			throw new System.NotImplementedException();
		}

		public IDictionary CloneCustomMetadata() {
			throw new System.NotImplementedException();
		}

		public string ItemSpec {
			get { return "test.nuspec"; }
			set { throw new System.NotImplementedException(); }
		}

		public ICollection MetadataNames {
			get { return _metadata.Keys; }
		}

		public int MetadataCount {
			get { return _metadata.Count; }
		}
	}
}